/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package com.lineage.server.storage;

import com.lineage.server.model.Instance.L1PcInstance;

/**
 * Class <code>CharacterStorage</code> 超级接口:储存角色.
 * 
 * @author jrwz
 * @version 2012-5-9下午09:24:21
 * @see com.lineage.server.storage
 * @since JDK1.7
 */
public interface CharacterStorage {

    /**
     * 创建角色.
     * 
     * @param pc
     *            角色
     * @throws Exception
     *             构造详细消息为 null 的新异常。原因尚未被初始化，可在以后通过调用 Throwable.initCause(java.lang.Throwable) 对其进行初始化。
     */
    void createCharacter(L1PcInstance pc) throws Exception;

    /**
     * 删除角色.
     * 
     * @param accountName
     *            账号名称
     * @param charName
     *            角色名称
     * @throws Exception
     *             构造详细消息为 null 的新异常。原因尚未被初始化，可在以后通过调用 Throwable.initCause(java.lang.Throwable) 对其进行初始化。
     */
    void deleteCharacter(String accountName, String charName) throws Exception;

    /**
     * 加载角色.
     * 
     * @param charName
     *            角色名称
     * @return 角色名称
     * @throws Exception
     *             构造详细消息为 null 的新异常。原因尚未被初始化，可在以后通过调用 Throwable.initCause(java.lang.Throwable) 对其进行初始化。
     */
    L1PcInstance loadCharacter(String charName) throws Exception;

    /**
     * 储存角色.
     * 
     * @param pc
     *            角色
     * @throws Exception
     *             构造详细消息为 null 的新异常。原因尚未被初始化，可在以后通过调用 Throwable.initCause(java.lang.Throwable) 对其进行初始化。
     */
    void storeCharacter(L1PcInstance pc) throws Exception;
}
